using System.Web.Security;
using Moq;
using NUnit.Framework;
using RMH.Entities;
using RMH.Services;

using RMH.Web.RMHMembership;

namespace RMH.UnitTests.Membership
{
    [TestFixture]
    public class RMHMembershipProvider_when_creating_a_user : base_automock_test
    {
        string userName = "ignu";
        string password = "test";
        string email = "ignu.smith@gmail.com";
        MembershipCreateStatus status;

        public override void because()
        {
            return; // TODO: need to test but providers suck
            Create<RMHMembershipProvider>()
                .CreateUser(userName, password, email, "","",true,null, out status);
        }

        [Test]
        public void membership_status_should_be_Success()
        {
            Assert.Ignore("Need to test, but providers suck");
            status.ShouldEqual(MembershipCreateStatus.Success);
        }

        [Test]
        public void alL_properites_are_persisited()
        {
            Assert.Ignore("Need to test, but providers suck");
            Mock<IStaffService>()
                .Verify(service=>service.Save(It.Is<Staff>( s=>
                    s.Email == email &&
                    s.Password != password && s.Password.Length > 0 && /* crappy test */
                    s.UserName == userName)));
        }
    }
}